<%--
  Created by IntelliJ IDEA.
  User: PC
  Date: 2017/5/24
  Time: 22:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <meta charset="UTF-8">
    <title>学生个人就业信息</title>
    <%--<meta name="renderer" content="webkit">--%>
    <%--<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">--%>
    <%--<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">--%>
    <%--<meta name="apple-mobile-web-app-status-bar-style" content="black">--%>
    <%--<meta name="apple-mobile-web-app-capable" content="yes">--%>
    <%--<meta name="format-detection" content="telephone=no">--%>
    <link rel="stylesheet" type="text/css" href="../../static/common/layui/css/layui.css" media="all">
    <link rel="stylesheet" type="text/css" href="../../static/common/global.css" media="all">
    <link rel="stylesheet" href="../../static/css/table.css">

</head>
<body>
<div style="margin:15px;" id="Vue" v-cloak>
    <div v-show="show">
        <blockquote class="layui-elem-quote">
            <a href="#" class="layui-btn layui-btn-small" @click="add">
                <i class="layui-icon">&#xe608;</i> 添加
            </a>
        </blockquote>
        <fieldset class="layui-elem-field">
            <legend>就业信息</legend>
            <div id="view_effective"></div>
            <div id="view_invalid"></div>
        </fieldset>
    </div>
    <div v-show="!show" style="display: none">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px">
            <legend>就业信息</legend>
        </fieldset>
        <form class="layui-form" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label">用人单位</label>
                <div class="layui-input-inline">
                    <select id="org" name="org" v-model="employmentInfo.employerid" lay-filter="org" lay-search>
                        <option value="" selected>选择公司</option>
                    </select>
                </div>
                <span>若尚无用人单位记录，则点击<a href="/student/orgInfo?operateType=1&origin='/student/Employment'" style="text-decoration: underline;color:blue;">添加用人单位信息</a><br/>添加单位信息完成后待
                    通过审核再添加就业信息</span>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">三方协议签订日期</label>
                <div class="layui-input-inline">
                    <input id="signdate" type="text" name="signdate" class="layui-input" v-model="employmentInfo.signdate" onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD'})">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="button" class="layui-btn" value="保存" lay-filter="save" lay-submit>
                    <input type="button" class="layui-btn" @click="reload" value="返回">
                    <%--<input type="button" class="layui-btn" lay-filter="addCompany" value="新增用人单位信息" lay-submit>--%>
                </div>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">
    var userid = ${sessionScope.currentUser.getId()};
    var employmentInformation_effective = [];
    var employmentInformation_invalid = [];
    var company = [];
</script>
<script id="demo" type="text/html">
    <div class="panel-group" id="accordion">
        {{# layui.each(d,function(index,item){ }}
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">

                    {{# var id= "" ; }}
                    {{# if(item.employmentInfo.valid=="1"){ }}
                    {{# var valid = "有效";}}
                    {{# id= "#effective"+ index; }}
                    {{# }; }}
                    {{# if(item.employmentInfo.valid=="2"){ }}
                    {{# var valid = "无效";}}
                    {{# id= "#invalid"+ index; }}
                    {{# };}}

                    {{# document.getElementById(index);}}
                    <a data-toggle="collapse" data-parent="#accordion" href={{ id }}>{{item.orgInfo.fullname||"未记录名字"}}</a>
                    <span style="float:right">({{valid}})</span>
                </h4>
            </div>
            {{# if(valid === "无效"){ }}
            <div id="invalid{{index}}" class="panel-collapse collapse">
            {{# }; }}
            {{# if(valid === "有效"){ }}
            <div id="effective{{index}}" class="panel-collapse collapse in ">
            {{# }; }}
                <form class="panel-body layui-form">
                    <div class="layui-form-item" style="font-size: 18px">
                        <label class="layui-form-lable">单位全称</label>
                        <span>{{item.orgInfo.fullname}}</span>
                        <%--<input type="text" name="fullname" class="layui-input" value="{{item.orgInfo.fullname}}">--%>
                    </div>
                    <div class="layui-form-item" style="font-size: 18px">
                        <label class="layui-form-lable">单位简称</label>
                        <span>{{item.orgInfo.shortname}}</span>
                    </div>
                    <div class="layui-form-item" style="font-size: 18px">
                        <label class="layui-form-lable">单位地址</label>
                        <span>{{item.orgInfo.addr}}</span>
                    </div>
                    <div class="layui-form-item" style="font-size: 18px">
                        <label class="layui-form-lable">单位联系人</label>
                        <span>{{item.orgInfo.contactor}}</span>
                    </div>
                    <div class="layui-form-item" style="font-size: 18px">
                        <label class="layui-form-lable">联系电话</label>
                        <span>{{item.orgInfo.phone}}</span>
                    </div>
                    <div class="layui-form-item" style="font-size: 18px">
                        <label class="layui-form-lable">单位网址</label>
                        <a target="_blank" href="{{item.orgInfo.url}}">{{item.orgInfo.url}}</a>
                    </div>
                    <div class="layui-form-item" style="font-size: 18px">
                        <label class="layui-form-lable">三方协议签订日期</label>
                        {{# console.log(item.employmentInfo.signdate); }}
                        <span>{{getYearMonthDate(item.employmentInfo.signdate)||" "}}</span>
                    </div>
                </form>
            </div>
        </div>
        {{# }); }}
    </div>
</script>
<script src="../../static/common/layui/layui.js"></script>
<script src="../../static/common/vue.min.js"></script>
<script src="../../static/js/layuiModulesEX/common.js"></script>
<script src="../../static/common/axios.min.js"></script>
<link rel="stylesheet" href="../../static/common/bootstrap/css/bootstrap.min.css">
<script src="../../static/common/jquery/jquery-1.11.1.min.js"></script>
<script src="../../static/common/bootstrap/js/bootstrap.min.js"></script>
<script src="../../static/js/student/employmentInfo.js"></script>
</body>
</html>
